HTMLify
app.js
Views: 17 | Author: huxn-webdev
1 2 3 4 5 6 7 8 9 10 11 | const nav = document.querySelector(".nav"); window.addEventListener("scroll", fixNav); function fixNav() { if (window.scrollY > nav.offsetHeight + 150) { nav.classList.add("active"); } else { nav.classList.remove("active"); } } |